#ifndef RW1_H
#define RW1_H

// Implements readers/writers problem 1:  readers may starve writers
//

#include "rwsync.h"

class ReadersWritersProb1 : public ReadersWriters
{
	public:
		ReadersWritersProb1();
		~ReadersWritersProb1();

		bool8 initOk();

		bool8 beginRead();
		void endRead();

		bool8 beginWrite();
		void endWrite();

	protected:
		PCRITICAL_SECTION	mutex;
		uint32				nReaders;
		HANDLE				writer;
};

#endif
